<#assign basePath = request.contextPath >
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Basic DataGrid - jQuery EasyUI Demo</title>
   	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/icon.css">
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.easyui.min.js"></script>
</head>
<body>
	<div style="padding:5px;background:#fafafa;border:1px solid #ccc">
	    <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-ok" id="check">检查登录状态</a>
	    <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-ok" id="login">登录</a>
	</div>
	
	
	
    <div id="p" class="easyui-panel" style="padding:10px;margin-top:10px;">
        <p style="font-size:14px">请识别下图中的验证码</p>
       	<img src="" id="img"/>
		<div>
	   		<input name="code" class="f1 easyui-textbox"></input>
	   		<a href="##" id="submit">确认提交</a>
	   	</div>
    </div>
</body>
<script type="text/javascript">
$(function(){

	$("#check").click(function(){
		$.ajax({
			url: '${basePath}/sina/login/check.json',
			success: function(data){
				
			}
		});
	});
	
	$("#login").click(function(){
		$.ajax({
			url: '${basePath}/sina/login.json',
			success: function(data){
				$("#img").attr("src", data.img);
			}
		});
	});
	
	$("#submit").click(function(){
		var name = $("input[name='code']").val();
		if(!name){
			$.messager.alert('','请填写识别后的验证码');
		}
		$.ajax({
			url: '${basePath}/sina/login/submit.json',
			method: 'post',
			data:{
				code: name
			},
			success: function(data){
				
			}
		});
	});
	
});
</script>
</html>